Skip to content

Conversation

@litang99
Copy link
Contributor

@litang99 litang99 commented Nov 7, 2025

df.info()

output = buffer.getvalue()
assert expected in output
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you'll end up with "object" in output

Copy link
Contributor Author

@litang99 litang99 Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Different versions give different result.s
In the issue description, it expects datetime. But the latest version in the main branch output "object".
What should be correct value?
I am not sure if the latest main has a bug so that the output is "object" instead of "datetime".

tm.assert_frame_equal(df, expected)


def test_dt_to_pydatetime_conversion():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this test about info or the df["ts"] = call? that will determine what file this belongs in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is about info()
As described in the issue: a df has a column of type datetime[ns]. After to_pydatetime conversion, the reporter of the issue expects df.info() will show the column changes to datetime type, but still got datetime[ns] type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Conversion from datetime64[ns] to datetime does not effect .info() and probably not the DataFrame itself

2 participants